package ru.jexp.rcp.supply.n.commands;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.handlers.HandlerUtil;


public class HandlerCollapseAll extends AbstractHandler
{

	public static final String ID = "ru.jexp.rcp.supply.n.commands.handlercollapseall";
	
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException
	{
		TreeViewer viewer = (TreeViewer) HandlerUtil.getActiveSite(event).getSelectionProvider();
		viewer.collapseAll();
		return null;
	}

}
